package com.system.service.Impl;

import com.system.dao.TeacherMapper;
import com.system.entity.Teacher;
import com.system.service.teacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.CrossOrigin;

import java.util.List;
import java.util.Map;
@CrossOrigin
@Service
public class TeacherServiceImpl implements teacherService {
    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public Teacher findByTeacherId(Long id) {
        return teacherMapper.selectByPrimaryKey(id);
    }

    @Override
    public Teacher findByUserName(String tea_name) {
        return teacherMapper.findByUserName(tea_name);
    }

    @Override
    public int add(Teacher teacher) {
        return teacherMapper.add(teacher);
    }

    @Override
    public int edit(Teacher teacher) {
        return teacherMapper.edit(teacher);
    }

    @Override
    public int delete(Long tid) {
        return teacherMapper.delete(tid);
    }

    @Override
    public List<Teacher> findList(Map<String, Object> queryMap) {
        return teacherMapper.findList(queryMap);
    }

    @Override
    public List<Teacher> findAll() {
        return teacherMapper.findAll();
    }

    @Override
    public int getTotal(Map<String, Object> queryMap) {
        return teacherMapper.getTotal(queryMap);
    }
}
